package com.toolbox.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <p>
 * Description：
 * </p>
 *
 * @author Mango
 * @version v1.0.0
 * @date 2023-11-18 10:47
 * @see com.toolbox.enums
 */
@SuppressWarnings("ALL")
@Getter
@AllArgsConstructor
public enum ResponseStatusEnum {

    UNKNOWN_ERROR_TYPE(-1, "服务暂时不可用", "未知错误"),

    TOKEN_CAN_NOT_BE_EMPTY(-2, "Token不能为空！", "Token不能为空！"),
    TOKEN_PARSING_ERROR(-2, "Token解析错误！", "Token解析错误！"),
    TOKEN_EXPIRED(-2, "Token已过期！", "Token已过期！"),
    NO_PERMISSION(-3, "暂无权限", "暂无权限"),

    /**
     * 操作失败
     */
    FAIL(-10, "操作失败", "内部服务器错误"),

    /**
     * 操作成功
     */
    SUCCESS(0, "操作成功", "操作成功"),

    // ======================================== 通用异常 1XXX 开始 ========================================

    NULL_POINTER_EXCEPTION(1001, "请求参数不能为空", "请求参数不能为空"),
    NUMBER_FORMAT_EXCEPTION(1002, "数字格式错误", "数字格式错误"),
    HTTP_REQUEST_METHOD_NOT_SUPPORTED_EXCEPTION(1003, "请求方式错误", "请求方式错误"),
    FILE_SIZE_LIMIT_EXCEEDED(1004, "上传文件超出限制", "上传文件超出限制"),
    PLEASE_SELECT_UPLOAD_FILE(1005, "请选择上传文件", "请选择上传文件"),
    UPLOADING_OF_EMPTY_FILES_IS_NOT_ALLOWED(1006, "不允许上传空文件", "不允许上传空文件"),

    // ======================================== 用户、验证码、Token异常 2XXX 开始 ========================================
    E_MAIL_FORMAT_IS_INCORRECT(2000, "邮箱格式不正确！", "邮箱格式不正确！"),
    THE_ACCOUNT_NUMBER_OR_PASSWORD_IS_INCORRECT(2001, "帐号或密码不正确！", "帐号或密码不正确！"),
    THE_CURRENT_ACCOUNT_HAS_BEEN_DISABLED(2002, "当前帐户已被禁用！", "当前帐户已被禁用！"),
    CAPTCHA_HAS_EXPIRED(2003, "验证码已过期！", "验证码已过期！"),
    CAPTCHA_ERROR(2004, "验证码错误！", "验证码错误！"),

    // ======================================== Infra异常 3XXX 开始 ========================================

    ;

    /**
     * 状态值
     */
    private Integer code;

    /**
     * 谨慎定义,暴露给用户的错误提醒
     */
    private String message;

    /**
     * 给后端人员提示
     */
    public String details;

}
